package server.player;

import java.util.*;

import vo.MonsterVO;

public class MonsterInfoList {
	
	private ArrayList<MonsterInfo> list;
	
	public MonsterInfoList() {
		this.list = new ArrayList<MonsterInfo>();
		this.list.add(new MonsterInfo());
	}
	
	public synchronized void add(MonsterInfo info) {
		this.list.add(info);
	}
	
	public synchronized void remove(MonsterInfo info) {
		this.list.remove(info);
	}
	
	public synchronized MonsterInfo remove(int index) {
		MonsterInfo del = this.list.get(index);
		this.list.remove(index);
		return del;
	}
	
	public synchronized ArrayList<MonsterInfo> getList() {
		return this.list;
	}
	
	public synchronized void showMonsterInfoList() {
		System.out.println("");
		for(MonsterInfo monInfo: this.list) {
			System.out.println(String.format(""));
		}
	}
	
	public synchronized MonsterInfo getMonsterInfo(MonsterVO monster) {
		MonsterInfo monInfo = null;
		for(MonsterInfo mon : this.list) {
			if(mon.getMonster() == monster)
				return mon;
		}
		return monInfo;
	}
	
}
